From: Jan Beulich Date: Thu, 27 Feb 2020 14:45:31 +0000 (+0100) Subject: libxl/PCI: align reserved device memory boundary for HAP guests X-Git-Tag: archive/raspbian/4.14.0+80-gd101b417b7-1+rpi1^2~63^2~611 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=5f29f349818be5b4e06caae57727405a7ea1a978;p=xen.git libxl/PCI: align reserved device memory boundary for HAP guests As the code comment says, this will allow use of a 2Mb super page mapping at the end of "low" memory. Signed-off-by: Jan Beulich Acked-by: Wei Liu --- diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c index e0c3aa4998..f4007bbe50 100644 --- a/tools/libxl/libxl_dm.c +++ b/tools/libxl/libxl_dm.c @@ -562,6 +562,13 @@ int libxl__domain_device_construct_rdm(libxl__gc *gc, /* Just check if RDM > our memory boundary. */ if (rdm_start > rdm_mem_boundary) { + /* + * For HAP guests round down to a 2Mb boundary to allow use + * of large page mappings. + */ + if (libxl_defbool_val(d_config->c_info.hap) + && rdm_start > MB(2)) + rdm_start &= ~(MB(2) - 1); /* * We will move downwards lowmem_end so we have to expand * highmem_end.